package edu.uoc.tdp.pac3.to;

import edu.uoc.tdp.pac3.domain.Request;
import edu.uoc.tdp.pac3.domain.RequestNote;
import java.util.List;

/**
 * Classe de transferencia entre la base de dades i la vista.
 * D'aquesta manera podem passar la Incidencia i les seves Notes per si ens és util.
 * @author Gerard
 */
public class HistoricIncidenciaTO {
    
    private Request request;
    
    private List<RequestNote> requestNotes;
    
    String notes = null;

    public HistoricIncidenciaTO() {
    }

    public HistoricIncidenciaTO(Request request, List<RequestNote> requestNotes) {
        this.request = request;
        this.requestNotes = requestNotes;
    }
  
    public Request getRequest() {
        return request;
    }

    public void setRequest(Request request) {
        this.request = request;
    }

    public List<RequestNote> getRequestNotes() {
        return requestNotes;
    }

    public void setRequestNotes(List<RequestNote> requestNotes) {
        this.requestNotes = requestNotes;
    }
    
    public String getNotesString(){
        String notes = null;
        if(requestNotes != null && requestNotes.size() > 0){
            StringBuilder sb = new StringBuilder();
            for(RequestNote rq : requestNotes){
                sb.append(rq.toString());
            }
            notes = sb.toString();
        }
        return notes;
    }
    
    public void setNotesString(String notes){
        this.notes = notes;
    }

    
}
